function deleteIndent(number,own){
	own=$(own);
		$.ajax({//从后台手机号
			  url: "./Myservlet?method=deleteIndent&number="+number,
			  type: 'get',
			  dataType: "json",
			  error:function(XMLHttpRequset,textStatus,errorThrown){
				  console.log("请求错误");
				  console.log(errorThrown);
			  },
			  success: function(data) {
				  data=data.code;
				  if(data==1){
					  console.log("success");
					  own.text("已删除");
				  }
			  }
		});
	}

var zc_user_id='';

$(function(){
	function reTime(time,own,status,own1,money,number,txt){
        //var time=1800;//30分钟换算成1800秒
		//console.log(own);
		//console.log(time,status,money);
		if(status=="Y"){
			own.html('<p style="">已支付</p>');
			own1.html('<p>需支付￥'+money+'</p>'+
			    	'<a href="javascript:;">已支付</a>'+
			    	'<a class="cancelOrderBtn" onclick="deleteIndent('+number+',this)">删除订单</a>');
			return ;
		}else{
			own1.html('<p>需支付￥'+money+'</p>'+
					'<a href="./jsp/dhy/paymentT.jsp?number='+number+'&price='+money+'&txt='+txt+'" class="go-pay">立即支付</a>'+
			    	'<a class="cancelOrderBtn" onclick="deleteIndent('+number+',this)">取消订单</a>');
		}
		time=1800-time;
		console.log("time:"+time);
		if(time<=0){
			own.html('<p style="">支付超时</p>');
			own1.html('<p>需支付￥'+money+'</p>'+
	    	'<a href="javascript:;">已超时</a>'+
	    	'<a class="cancelOrderBtn" onclick="deleteIndent('+number+',this)">删除订单</a>');
			return ;
		}
        setInterval(function(){
            time=time-1;
            if(time<=0){
            	own.html('<p style="">支付超时</p>');
            	own1.html('<p>需支付￥'+money+'</p>'+
            	    	'<a href="javascript:;">已超时</a>'+
            	    	'<a class="cancelOrderBtn" onclick="deleteIndent('+number+',this)">删除订单</a>');
    			return ;
            }
           var minute=parseInt(time/60);
           var second=parseInt(time%60);
           own.html('<p>剩余时间</p>'+
        		   '<p style="color:red">'+minute+'分'+second+'秒'+'</p>');
        },1000);
    }
	var index=$(".order-list-unit");
	zc_user_id=$("#user_id").val();
	console.log("zc_user_id-------->"+zc_user_id);
	$.ajax({//从后台手机号
		  url: "./Myservlet?method=getIndent&user_id="+zc_user_id,
		  type: 'get',
		  dataType: "json",
		  error:function(XMLHttpRequset,textStatus,errorThrown){
			  console.log("请求错误");
			  console.log(errorThrown);
		  },
		  success: function(data) {
			console.log("getident成功");
			data=data.code;
			//console.log(data);
			for(let i=0;i<data.length;i++){
				var html='<div class="order-list-line">'+
				'<ul class="order-list-line-head">'+
				'<li class="order-list-line-head-cell order-num">订单编号：<a'+
					'href="javascript:;" target="_blank">'+data[i][0]+'</a></li>'+
				'</ul>'+
				'<div class="order-list-line-wrap">'+
					'<ul class="order-list-line-body">'+
						'<li class="order-list-line-body-cell li-cell1"><a'+
							'href="javascript:;" target="_blank">'+data[i][1]+'</a></li>'+
						'<li class="order-list-line-body-cell li-cell3 time'+i+'">'+
							'</li>'+
						//'<li class="order-list-line-body-cell li-cell3">'+
						//	'<div>'+
						//		'<p class="state-wait">等待支付</p>'+
						//	'</div>'+
						//'</li>'+
						'<li class="order-list-line-body-cell li-cell8">'+
							'<div class="timeo'+i+'">';
							   // if(data[i][4]=="Y"){
							   // 	html+='<p>需支付￥'+data[i][3]+'</p>'+
							   // 	    	'<a href="javascript:;">已支付</a>'+
							   // 	    	'<a class="cancelOrderBtn">删除订单</a>';
							   // }
							html+='</div>'+
						'</li>'+
					'</ul>'+
				'</div>'+
				'</div>';
				index.append(html);
				reTime(data[i][2],$(".time"+i),data[i][4],$(".timeo"+i),data[i][3],data[i][0],data[i][1]);
			}
		  }
	});
});